<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page language="java" import="com.knowledge.model.Comment"%>
<%@ page language="java" import="java.util.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>查看日志</title>
		<%
			List<Comment> commentList = (List<Comment>)request.getAttribute("commentList");
			String userId = (String)request.getAttribute("userId");
			String knowledgeId = String.valueOf(request.getAttribute("knowledgeId"));
		%>
		<link href="css/layout.css" type="text/css" rel="stylesheet"
			media="all">
		<link href="css/html.css" type="text/css" rel="stylesheet" media="all">
		<link href="css/ua.css" type="text/css" rel="stylesheet" media="all">
		<link href="css/blog.css" type="text/css" rel="stylesheet" media="all">
		<link href="css/editor.css" type="text/css" rel="stylesheet"
			media="all">
		<link rel="stylesheet" type="text/css" href="css/fonts-min.css" />
		<link rel="stylesheet" type="text/css"
			href="css/skins/sam/container.css" />
		<link rel="stylesheet" type="text/css" href="css/skins/sam/menu.css" />
		<link rel="stylesheet" type="text/css" href="css/skins/sam/button.css" />
		<link rel="stylesheet" type="text/css" href="css/skins/sam/editor.css" />
		<link href="css/header.css" rel="stylesheet" type="text/css" />

		<script type="text/javascript" src="js/utilities.js"></script>
		<script type="text/javascript" src="js/container-min.js"></script>
		<script type="text/javascript" src="js/menu-min.js"></script>
		<script type="text/javascript" src="js/button-min.js"></script>
		<script type="text/javascript" src="js/editor-min.js"></script>
		<script type="text/javascript" src="js/comment.js"></script>

		<style>
		
.yui-skin-sam .yui-toolbar-container .yui-toolbar-inserticon span.yui-toolbar-icon
	{
	background-image: url( img/face/face.gif );
	background-position: 1px 0px;
	left: 5px;
}

.yui-skin-sam .yui-toolbar-container .yui-button-insertdate-selected span.yui-toolbar-icon
	{
	background-image: url( img/face/face.gif );
	background-position: 1px 0px;
	left: 5px;
}

#inserticon {
	border: 1px solid #   #BDC7D8;
	padding: 5px;
	background-color: #FFFFFF;
}

#inserticon a {
	display: block;
	float: left;
	border: 1px solid #F2F2F2;
}

#inserticon a:hover {
	border: 1px solid #808080;
}
</style>

<style>
	.blog-home{float:left;width:700px;clear:both;}
	input,label,span,select,h2,h3,p,a,strong{text-align:left}
	.section-header,.text-article{text-align:left}
</style>

	</head>
	<body id="blogpage" class="yui-skin-sam">
		<jsp:include page="header.jsp"></jsp:include>
	<center>	
		<div id="container">
			<div id="opi" class="page-wrapper clearfix">
				<div class="full-page-holder">
					<div class="full-page clearfix">
						<div class="main-page">
							<div class="section-header">
								<div class="section-avatar">

								</div>
								<div class="section-avatar">
									<a href="" style="background-image: url();" /></a>
								</div>

								<div id="oak" class="white-gray">
									<div class="blog-home">
										<h3 class="title-article margin-top">
											<%String user=request.getParameter("user");%>
											<%if("own".equals(user)){ %>
											<span class="edit"> <a
												href="knowledgeedit.action?userId=${requestScope.userId }&knowledgeId=${requestScope.knowledgeId } ">编辑</a>
												<span class="pipe">|</span> <a
												href="delete.action?knowledgeId=${requestScope.knowledgeId }"
												onclick="var bl=confirm('确定删除本日志项吗？'); if(bl){return true;} else {return false;}">删除</a>
											</span>
											<%} %>
											<strong>${requestScope.title }</strong>
											<span class="timestamp"> ${requestScope.addtime }</span>
										</h3>
										<div id="blogContent" class="text-article">
											<h1>
												${requestScope.title }
											</h1>
											<div class="time">
												时间：
												<span class="timestamp"> ${requestScope.addtime }</span>
											</div>
											<div class="cont">
												<p>
													&nbsp;&nbsp;&nbsp;&nbsp; ${requestScope.content }
												</p>
											</div>
											<p class="stat-article">
												<span class="float-right"> <a href="">发表评论</a>
													<span class="pipe">| </span> <span id="commend_info">
														<a href="">举报日志</a> </span> </span> 阅读
												<span class="pipe">|</span> 评论
											</p>
										</div>


										<div id="comments">
											<ol class="commentlist" id="commentlist">
												<%
													for (Comment cmt : commentList) {
												%>
												<li class="even" id="<%=cmt.getId()%>">
													<div class="comment">
														<div class="picture">
															<a class="usericon" href="<%=cmt.getUserUrl()%>"><img
																	alt="<%=cmt.getUserName()%>" src="<%=cmt.getImgUrl()%>" />
															</a>
														</div>
														<div class="info">
															<span class="author"><a
																href="<%=cmt.getUserUrl()%>"><%=cmt.getUserName()%></a>
															</span>
															<!--别人的评论-->
															<%
																if (cmt.getUserId().equals(userId)) {
															%>
															<!--自己的评论-->
															<span class="remove"><a href="javascript:void(0)"
																onclick=delComment(<%=cmt.getId()%>)>删除</a> </span>
															<%
																} else {
															%>
															<span class="reply"><a href="javascript:void(0)"
																onclick="reply('<%=cmt.getUserName()%>','<%=cmt.getUserId()%>');  return false;">回复</a>
															</span>
															<%
																}
															%>
															<span class="timestamp"><%=cmt.getAddTimeString()%></span>
														</div>
														<div class="content"><%=cmt.getContent()%></div>
													</div>
												</li>

												<%
													}
												%>
											</ol>

										</div>
										<div id="container"></div>
										<div>
											<form method="post" action="#" id="commentForm">
												<textarea id="editor" name="editor" rows="20" cols="75">
													</textarea>
												<br>
												<p class="actions align-left">
													<input value="发表评论" class="input-submit" tabindex="4" type="button" onClick="postComment(<%=userId%>,<%=knowledgeId%>)">
												</p>
												<input id='replierId' value='' type='hidden'>
											</form>


										</div>



									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<jsp:include page="footer.jsp"></jsp:include>
		</center>
	</body>

</html>
